CC=gcc
CPP=g++
MAKE=make

all: bit.o draw barre.o entro
	$(MAKE) -C lz
	$(MAKE) -C pretraitement
	$(MAKE) -C huffman

	$(CC) -Wall main.c bit.o PS_draw.o barre.o lz/lz78.o lz/lz77.o lz/prefix-tree.o pretraitement/mtf.o pretraitement/bwt.o huffman/huffman.o huffman/heap.o -o compress 

.c.o:
	$(CC) -std=c99 -c -Wall $< -o $@

.cpp.o:
	$(CPP) -c -Wall $< -o $@


testbit: bit.o
	$(CC) -std=c99 test.c bit.o -o testbit

huffman:
	$(MAKE) -C huffman
	
lz:
	$(MAKE) -C lz


draw:
	$(CC) -std=c99 -c -Wall PS_draw.c -o PS_draw.o

entro:
	$(CC) -std=c99 -Wall entropie.c -o entro -lm
	
clean:
	rm PS_draw.o bit.o barre.o entro compress
	$(MAKE) clean -C lz
	$(MAKE) clean -C pretraitement
	$(MAKE) clean -C huffman
